/*  static char SccsId[] = "@(#)acfile.h	1.7   8/1/95";
 *
 *		Copyright (c) KUBOTA Corporation,
 *		1994, 1995 All Rights Reserved
 *
 *  This software comprises unpublished confidential information of 
 *  KUBOTA Corp. and may not be used, copied or made available to anyone,
 *  except in accordance with the license under which it is furnished.
 */

#include "actype.h"

#ifndef _AURORA_DATA_FILE_HEADER_
#define	_AURORA_DATA_FILE_HEADER_

/********************************************************
   ALL the DATA Blocks must be aligned on 64 bit.
**********************************************************/

#define AC_ALIGN64(a)	((a%8)?((a/8)+8):(a))  /* 8 byte align */

/*------------------------------------------------------------------*/
#ifndef	NULL
#define	NULL	(0)
#endif

/*------------------------------------------------------------------*/
/* Magic code string <magic_code> */
#define	AGD_MAGIC		"AGD"		/* 'A' 'G' 'D' '\0' */
#define	AID_MAGIC		"AID"		/* 'A' 'I' 'D' '\0' */
#define	ACD_MAGIC		"ACD"		/* 'A' 'C' 'D' '\0' */

/* Version code string <version> */
#define	AC_VERSION_10a		"10a"		/* '1' '0' 'a' '\0' */
#define	AC_VERSION_20a		"20a"		/* '2' '0' 'a' '\0' */

/* Display mode <display_mode> */
#define AC_DISP_MODE_NRM	(0)		/* 256x256 */
#define AC_DISP_MODE_WDM	(1 << 0)	/* 320x200 */

/* Colormap type <colormap_type> */
#define AC_CMAP_TYPE_INDEX9		0
#define AC_CMAP_TYPE_INDEX12		1
#define AC_CMAP_TYPE_I3C6		2
#define AC_CMAP_TYPE_I4C5		3
#define AC_CMAP_TYPE_I5C4		4
#define AC_CMAP_TYPE_I6C3		5
#define AC_CMAP_TYPE_I6C6		6

/* Colormap id <colormap_id> */
#define AC_DEFAULT_CMAP_ID		1

/* Color type definitions */
#define	AC_COLOR_TYPE_INDEX9		0
#define	AC_COLOR_TYPE_INDEX12		1
#define	AC_COLOR_TYPE_INDEX16		2
#define	AC_COLOR_TYPE_INDEX8		3
#define	AC_COLOR_TYPE_UNPACK12		4
#define AC_COLOR_TYPE_YUV888		16
#define AC_COLOR_TYPE_YUV844		17
#define AC_COLOR_TYPE_RGB888		32
#define AC_COLOR_TYPE_RGB555		33

/*------------------------------------------------------------------*/
/*	Aurora Common Header File Format			    */
/*------------------------------------------------------------------*/

typedef struct { /* 64 bytes */
/* Aurora common file header structure member  <48 bytes> */
	CARD8	magic_code[4];		/*  0..3 */
	CARD8	version[4];		/*  4..7 */
	CARD8 	tool_name[16];		/*  8..23 */
	CARD8 	comment[16];		/* 24..39 */
	CARD32	file_size;		/* 40..43 */
	CARD32	reserved0;		/* 44..47 */
/* Aurora tools characteristic structure member <16 bytes> */
	CARD8	acparam[16];		/* 48..63 */
} acfilehdr_t;



/*------------------------------------------------------------------*/
/* Aurora Data file Type define			*/
/*                                ++======== reserve	*/
/*				  ||++====== data type	*/
/*                   		  ||||+--+== version #  */
#define	ACFILETYPE_NONE		0x00000000
#define	ACFILETYPE_AGD		0x00010000
#define	ACFILETYPE_AID		0x00020000
#define	ACFILETYPE_ACD		0x00030000
#define	ACFILETYPE_BADFILE	0xffff0000

#define	ACFILETYPE_10a		0x00001001	/* 10(hex)="10",01(hex)="a" */
#define	ACFILETYPE_10b		0x00001002	/* 10(hex)="10",02(hex)="b" */
#define	ACFILETYPE_10c		0x00001003	/*            :             */
#define	ACFILETYPE_20a		0x00002001	/* 20(hex)="20",01(hex)="a" */
#define	ACFILETYPE_20b		0x00002002	/* 20(hex)="20",02(hex)="b" */
#define	ACFILETYPE_20c		0x00002003	/*            :             */
#define	ACFILETYPE_BADVERSION	0xff00ffff

#define	ACFILETYPE_ILLEGAL	0xffffffff	/* was -1 */
#define	ACFILETYPE_ERROR	0xfffffffe	/* was -2 */

#define	ACFILETYPE_CTRLMASK	0xff000000
#define	ACFILETYPE_TYPEMASK	0x00ff0000
#define	ACFILETYPE_VERSIONMASK	0x0000ffff

typedef	CARD32	acfiletype_t;			/* signed 32bit integer */

#endif	/* _AURORA_DATA_FILE_HEADER_ */
